//
//  MOHomeViewCell.m
//  MobileOffice
//
//  Created by 冰冰 on 2019/5/31.
//  Copyright © 2019 com.idolmedia. All rights reserved.
//

#import "MOHomeViewCell.h"

@interface MOHomeViewCell ()

@property(nonatomic,strong)UIImageView *iconImageView;

@property(nonatomic,strong)UILabel *nameLabel;

@property(nonatomic,strong)UILabel *descLabel;

@end

@implementation MOHomeViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        [self creatView];
    }
    return self;
}

-(void)creatView
{
    CGFloat width = SCREEN_WIDTH/2;
    self.iconImageView = [[UIImageView alloc]initWithFrame:CGRectMake(25, 0, kWConversions(43), kWConversions(43))];
//    self.iconImageView.backgroundColor = [UIColor magentaColor];
    self.iconImageView.layer.masksToBounds = YES;
    self.iconImageView.layer.cornerRadius = 10.0;
    [self addSubview:self.iconImageView];
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.iconImageView.right + 8, self.iconImageView.y + kWConversions(5.5), width - kWConversions(43) - 25 - 8, 14)];
    self.nameLabel.font = FONT_SIZE(14);
    self.nameLabel.textColor = KBlackColor_2A2A2A;
    [self addSubview:self.nameLabel];
    
    self.descLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.iconImageView.right + 8, self.nameLabel.bottom + kWConversions(8), width - kWConversions(43) - 25 - 8, 11)];
    self.descLabel.font = FONT_SIZE(12);
    self.descLabel.textColor = KBlackColor_919395;
    [self addSubview:self.descLabel];
}

-(void)setModel:(MOHomeModel *)model
{
    self.iconImageView.image = IMAGE(model.imageStr);
    
    self.nameLabel.text = model.nameStr;
    
    self.descLabel.text = model.descStr;
}


@end
